home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Languguage OS 2
/
Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO
/
a_utils
/
_archvrs
/
amiga
/
pplib.lzh
/
PPLib
/
oberoninterface
/
Example.mod
next >
Wrap
Text File
|
1991-04-08
|
2KB
|
55 lines
(*********************************
* *
* powerpacker.library V35 *
* *
* Release 2.0 *
* *
* (c) Mar 1991 Nico Franτois *
* *
* Example.mod *
* *
* This source is public domain *
* in all respects. *
* *
*********************************)
MODULE Example;
IMPORT
pp: PowerPacker, e: Exec, io;
CONST
file = "testfile";
VAR
filestart: e.ADDRESS;
filelen: LONGINT;
err: LONGINT;
BEGIN
filestart := NIL;
io.WriteString ("Loading file...\n");
err := pp.LoadData (file, pp.DecrPoint, LONGSET {}, filestart, filelen, NIL);
IF err # pp.LoadOk THEN
CASE err OF
| pp.ReadErr: io.WriteString ("Error loading text file !\n");
| pp.NoMemory: io.WriteString ("No memory to decrunch file !\n");
| pp.PassErr: io.WriteString ("Incorrect password, loading aborted !\n");
| pp.OpenErr: io.WriteString ("Can't open file !\n");
| pp.UnknownPP: io.WriteString ("Crunched with unknown PP !\n");
ELSE
io.WriteString ("Unknown error !\n");
END; (* CASE *)
ELSE
io.WriteString ("file in memory, using it...\n");
(* file is loaded at 'filestart' and can now be used *)
(* ... *)
io.WriteString ("done, freeing file...\n");
END; (* IF *)
CLOSE
IF filestart # NIL THEN e.FreeMem (filestart, filelen); filestart := NIL END;
io.WriteString ("exiting.\n");
END Example.